The approaches described in this section are approaches that could be pursued, but not necessarily approaches that have been previously conceived or pursued. Therefore, unless otherwise indicated, it should not be assumed that any of the approaches described in this section qualify as prior art merely by virtue of their inclusion in this section.
The eXtensible Markup Language (XML) is a standard for data and documents that is finding wide acceptance in the computer industry. XML describes and provides structure to a body of data, such as a file, a data stream, or a data packet. The specification for XML was developed by the W3C consortium and is located on the Internet at “http://www.w3.org/XML”. As initially defined, the XML specification organizes information in XML nodes, where the XML nodes form a tree that consists of a root node and all the nodes that are hierarchically dependent on the root node. A tree of XML nodes whose root node is of a “Document Node” type is referred to as an XML document; a tree whose root node is not of a “Document Node” type is referred to as an XML fragment.
For example, the following Segment A
<?xml version=“1.0”><book><publication publisher=“Doubleday”year=“2003”></publication><author>Mark Berry</author></book>is an XML 1.0 document as indicated by the <?xml version=“1.0”> declaration. On the other hand, the following Segment B
<book><publication publisher=“Doubleday”year=“2003”></publication><author>Mark Berry</author></book>is an XML fragment because its root node “<book>” is not a document node.
As initially defined, the XML specification provides for tags that delimit the sections of an XML entity, which sections are also referred to as XML elements. The data included between the tags is referred to as the XML element's content. Each XML element may contain one or more name-value pairs referred to as attributes. For example, in Segment B above, the start tag “<author>” and the end tag “</author>” delimit an XML element whose content is “Mark Berry”. The XML element delimited between the “<publication>” and “</publication>” tags includes two attributes: “publisher” which has a value of “Doubleday”, and “year” which has a value of “2003”.
The wide acceptance of XML as a standard for processing data led to the development of XML-enabled database systems. Some XML-enabled Relational Database Systems (RDBMS) and Object-Relational Database Systems (ORDBMS) provide a native built-in data type (referred to herein as XMLType) which allows users to store XML data natively via the use of XMLType tables or XMLType columns. Other XML-enabled database systems provide extensions and plug-ins that are capable of accessing and processing XML data stored as XML documents in XML repositories or other storage.
The ability to store XML data in database systems in turn led to the development of a new query language, the XML Query Language (referred to hereinafter as “XQuery”), for accessing and querying a broad spectrum of XML data and XML information resources. In order to support this new query language, a new data model, the XQuery Data Model, was developed. The XQuery Data Model defines precisely the information contained in the input to an XSLT or XQuery processing system and also defines all permissible values of expressions in the XQuery, XPath, and XSLT languages. A draft specification for XQuery is described in “XQuery 1.0: An XML Query Language”, W3C Working Draft 4 Apr. 2005, located at “http://www.w3.org/TR/xquery/”, the entire contents of which are incorporated by reference for all purposes as if fully set forth herein. A draft specification for XPath is described in “XML Path Language (XPath) 2.0”, W3C Working Draft 4 Apr. 2005, located at “http://www.w3.org/TR/xpath20/”, the entire contents of which are incorporated by reference for all purposes as if fully set forth herein. A draft specification for XSLT is described in “XSL Transformations (XSLT) Version 2.0”, W3C Working Draft 4 Apr. 2005, located at “http://www.w3.org/TR/xslt20/”, the entire contents of which are incorporated by reference for all purposes as if fully set forth herein. A draft specification for the XQuery Data Model is described in “XQuery 1.0 and XPath 2.0 Data Model”, W3C Working Draft 4 Apr. 2005, located at “http://www.w3.org/TR/xpath-datamodel/”, the entire contents of which are incorporated by reference for all purposes as if fully set forth herein.
The XQuery Data Model is generally based on the XML specification, but further requires support of at least the following new features:                Support for XML Schema types. The XML Schema recommendations define features, such as structures and simple data types, that extend the definitions in the XML specification with precise type information;        Representation of collections of documents and of complex values; and        Support for typed atomic values.        
In order to support processing of queries defined according to this new XQuery Data Model, an XML-enabled computer system or systems need to provide for efficient representation and processing of instances of this data model. As referred to herein, an instance of the XQuery Data Model is a block of data that conforms to the requirements set forth in the data model specification. For example, the processing of the following query written in the XQuery language,
<bib>{for $b in doc (“http://bstore1.examp1e.com/bib.xml”) /bib/bookwhere $b/publisher = “Addison-Wesley” and $b/@year > 1991return<book year=“{ $b/@year }”>{ $b/title }</book>}</bib>requires at least parsing the query and identifying the instances of the XQuery Data Model, compiling the query and optimizing it if necessary, executing the query, and returning any result set to user.
Since the tasks related to processing an XQuery query may be performed by separate components of the same or a different computer system, the XQuery Data Model instances need to be represented in a uniform manner that is recognizable by the different components and/or computer systems. However, the currently existing mechanisms and techniques for representing XML information do not provide support for the new, strongly typed structural elements defined in the XQuery Data Model, such as, for example, atomic values and document nodes. For example, in an XML-enabled RDBMS that provides a native XMLType, the techniques described in the '393 application provide for representing and transferring a serialized image of XML data. However, since these techniques are developed to support XML data that conforms to the original XML specification, these techniques provide only for representing XML documents and XML fragments and do not address the issues raised by the introduction of the new, strongly typed structural elements in the XQuery Data Model.
Based on the foregoing, there is a clear need for techniques that provide for an efficient representation of instances of the XQuery Data Model that may be used in a variety of operational contexts.